import requests
from bs4 import BeautifulSoup

url = 'https://www.shixiseng.com/interns'
params = {
    'page': 1,
    'keyword': 'python实习生',
    'city': '全国',
    'type': 'intern'
}
headers = {
    'User-Agent':
        'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 SLBrowser/9.0.6.5061 SLBChan/105 SLBVPV/64-bit',
    'Cookie':
        'RK=qZnEdVPg0C; pgv_pvid=6179245110; fqm_pvqid=07f0ab31-a3a1-44f1-a36f-105de10bb256; qq_domain_video_guid_verify=f7da0a7a54218f14; o_cookie=2981702923; pac_uid=0_pBxHhnB3wZnnG; suid=user_0_pBxHhnB3wZnnG; _qimei_uuid42=1940a0930001008b23e949f58ef3a94220d5b98d16; _qimei_fingerprint=985f363a421c053055e49b2ec75d8caf; lcad_appuser=4BC2F81356564212; _qimei_q32=0363937a2cb78d09f38dff2c80655183; _qimei_q36=85050387ea18f25f838bef63300012d17807; ptcz=eff379f35d57efe3c7461bcc63e9fa3e5947705fab4cda4c73c6c81072ea9dd4; pgv_info=ssid=s8463836602; _qpsvr_localtk=0.9124714855401004; video_omgid=f7da0a7a54218f14; omgid=0_pBxHhnB3wZnnG; current-city-name=sh; _qimei_h38=92a7556823e949f58ef3a94202000007d1940a; lcad_o_minduid=bTMgjsjkoKaP5yhF5kh0KAHplHTidUAP; lcad_LPSJturn=0; lcad_LBSturn=123; lcad_LVINturn=940; lcad_LDERturn=111'
}
htlm = requests.get(url, headers=headers, proxies=params)
soup = BeautifulSoup(htlm.text, 'lxml')
data_list = soup.find('div', class_='interns')
data_list = data_list.find('div', class_='result-list clearfix')
data_list = data_list.find('div', class_='primary-content f-l')
data_list = data_list.find_all('div', class_='intern-wrap interns-point intern-item')
for i in data_list:
    data = i.find('div', class_='f-l intern-detail__job')
    data1 = data.find('a')
    print('url',data1.get('href'))
    print('标题',data1.get('title'))
    print('职位',data1.text)
print(len(data_list))